//--------------------------------------------------------------------------------------------
//   : 
//      Component name  : packfp
//      Author          : 
//      Company         : 
//
//      Description     : 
//
//
//--------------------------------------------------------------------------------------------


module PackFP(SIGN, EXP, SIG, isNaN, isINF, isZ, FP);
   input         SIGN;
   input [7:0]   EXP;
   input [22:0]  SIG;
   input         isNaN;
   input         isINF;
   input         isZ;
   output [31:0] FP;
   reg [31:0]    FP;
   
   
   always @(isNaN or isINF or isZ or SIGN or EXP or SIG)
      
      if (isNaN == 1'b1)
      begin
         FP[31] <= SIGN;
         FP[30:23] <= 8'hFF;
         FP[22:0] <= {3'b100, 20'h00000};
      end
      else if (isINF == 1'b1)
      begin
         FP[31] <= SIGN;
         FP[30:23] <= 8'hFF;
         FP[22:0] <= {32{1'b0}};
      end
      else if (isZ == 1'b1)
      begin
         FP[31] <= SIGN;
         FP[30:23] <= 8'h00;
         FP[22:0] <= {32{1'b0}};
      end
      else
      begin
         FP[31] <= SIGN;
         FP[30:23] <= EXP;
         FP[22:0] <= SIG;
      end
   
endmodule

